import {
  ArticleListVO,
  ArticlePageDTO,
  ArticleWithClassificationVO
} from '@/http/article/article.types.ts'
import { PageVO, RetVO } from '@/http/public.types.ts'
import service from '@/http'

/**
 * 获取文章列表
 * @param params
 */
export function _getArticleList(params: ArticlePageDTO): Promise<RetVO<PageVO<ArticleListVO[]>>> {
  return service.post('/api/blog/article/page', params)
}

/**
 * 获取分类文章列表
 */
export function _getClassificationArticleList(): Promise<RetVO<ArticleWithClassificationVO[]>> {
  return service.post('/api/blog/article/getClassificationArticleList')
}

/**
 * 获取文章详情
 * @param id
 */
export function _detailArticle(id: string): Promise<RetVO<ArticleListVO>> {
  return service.get('/api/blog/article/detail/' + id)
}
